1. Field of the Invention
The present invention relates to an IC card which has nonvolatile and volatile memories, and executes processes in accordance with an externally installed application, and a management method of a volatile memory in the IC card.
2. Description of the Related Art
In recent years, an environment (Java) used to execute a program on a network such as the Internet or the like has appeared, and is becoming increasingly prevalent along with the current Internet boom. Hence, an IC card that incorporates such an environment is developed.
In Java, an application (called an “applet”) created using the Java language runs on any device having a Java API (Application Interface), i.e., runs independently of the type of device (e.g., a personal computer, portable terminal, and the like) as long as it has a Java API. Only a required Java applet can be downloaded from the network and can be used when it is necessary.
For this reason, an IC card (Java card) to which the aforementioned merits of Java are applied by installing an application developed using the Java language in the IC card has been proposed.
For example, an application for a credit card and that for a debit card are installed to provide an IC card that can implement these two functions.
In such IC card, initialization data for respective applications are downloaded and stored in a nonvolatile memory, and an area for storing objects and the like generated upon processing of the application is prepared for each application.
In this case, nonvolatile and volatile objects are generated. A nonvolatile object is stored in an area prepared in the nonvolatile memory, and a volatile object is stored in an area prepared in a volatile memory. Also, stack data such as a confirmation code or the like, which can be deleted upon power OFF, is stored in the volatile memory.
However, in this arrangement, it is impossible to choose the address of the volatile memory where the volatile object is to be stored. Also, it is desirable that the application not manage the storage location of a volatile object.
In the IC card, the volatile memory is used as a work area for internal control. In such conventional IC cards, a volatile object is assigned from the highest address in the stack growth direction, and a stack is assigned from the lowest address of the volatile memory.
However, in the IC card in which an application is installed, as described above, it is desired to generate volatile objects upon running the application. Such dynamic volatile objects are assigned to an area higher than the stack in the volatile memory.
However, if a volatile memory is used like this stack growth may encroach on the volatile objects. To avoid such encroachment, a method of using a stack after it is inspected if stack growth is possible may be used. However, such a method is inefficient, and the stack use size of each process must be detected in advance.
The stack consumption size of each application process is not limited to that process, but often depends on its process history. In this manner, the maximum stack use size can be detected, but it is very difficult to obtain a stack use size in the current process.
It is an object of the present invention to provide an IC card which has nonvolatile and volatile memories, executes a process by an externally installed application, stores a nonvolatile object generated by the application in the nonvolatile memory, and stores a volatile object generated by the application in the volatile memory, wherein access can be made independently of whether an object generated and stored by the application is volatile or nonvolatile.
It is another object of the present invention to effectively use a volatile memory.
It is a further object of the present invention to attain a simple, high-speed process.
According to the present invention, in an IC card which has a nonvolatile memory for storing nonvolatile data and a volatile memory for storing volatile data, and executes a process by an externally installed application, the application is stored in the nonvolatile memory, nonvolatile data generated by the application is stored in the nonvolatile memory, volatile data associated with the nonvolatile data generated by the application is stored in the volatile memory, a storage address of the nonvolatile memory corresponding to the nonvolatile data, and a storage address of the volatile memory corresponding to the volatile data associated with that nonvolatile data are stored in a management table in correspondence with each other, when a storage address of the nonvolatile memory is designated by the application, nonvolatile data at the storage address of the nonvolatile memory is accessed, and the storage address of the volatile memory corresponding to this storage address of the nonvolatile memory is read out from the management table to access volatile data at the storage address of the volatile memory.
According to the present invention, in an IC card which has a volatile memory that stores nonvolatile objects and stack data as volatile data, and executes a process by an externally installed application, volatile objects generated by the application are stored in turn from lower addresses of the volatile memory, and stack data generated by the application is sequentially stored from the highest address of the volatile object in the volatile memory in a higher address direction.
According to the present invention, an IC card in which install data of an externally supplied application is installed, and which executes a process by the installed application, comprises a non-rewritable first nonvolatile storage unit for storing a basic program, a rewritable second nonvolatile storage unit for storing various applications, and storing nonvolatile data generated by the application, a volatile storage unit for storing volatile data generated by the application, execution means for executing a process on the basis of an application read out from the second nonvolatile storage unit in an operation environment defined by the basic program in the first nonvolatile storage unit, and a management table which stores a storage address of nonvolatile data in the second nonvolatile storage unit and a storage address of the volatile storage unit corresponding to volatile data associated with this nonvolatile data in correspondence with each other.